<script lang="ts" setup>
import { useRouter } from 'vue-router';
import { useAppStore } from "./stores/appConfig";
import { ShowHome } from "./common/userConfig"
import type { IDefaultConfig } from '@shared/constans/types/configType'
// const ipcHandle = () => window.electron.ipcRenderer.send('ping')

const router = useRouter();
const customizeTheme = useAppStore();
const firstTimeUsing: IDefaultConfig | {} = window.api.firstTimeUsing()

if (Object.keys(firstTimeUsing).length !==0 ) {
  // ipcHandle()
  ShowHome(firstTimeUsing, customizeTheme)
} else {
  router.push({name: 'config_server'})
}

</script>

<template>
<v-app :theme="customizeTheme.darkTheme ? 'dark' : 'light'">
  <v-main>
    <router-view></router-view>
  </v-main>
</v-app>
</template>
